package com.stylefeng.guns.modular.system.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.stylefeng.guns.modular.vpn.entity.NewUserInfoEntity;
import com.stylefeng.guns.modular.vpn.entity.RetentionUserInfo;
import com.stylefeng.guns.modular.vpn.entity.StatisticsFinancialInfoEntity;
import com.stylefeng.guns.modular.vpn.entity.StatisticsFinancialPackageInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 定时任务相关方法的查询
 */
@Mapper
public interface VpnTimerStatisticsMapper extends BaseMapper {

    StatisticsFinancialInfoEntity queryLastFinancialInfo();
    StatisticsFinancialPackageInfoEntity queryLastFinancialPackageInfo();

    //统计财务数据
    List<StatisticsFinancialInfoEntity> statisticsFinancialInfo(
            @Param("lastDate") String lastDate);
    //统计财务数据中的套餐分类信息
    List<StatisticsFinancialPackageInfoEntity> statisticsFinancialPackageInfo(
            @Param("lastDate") String lastDate);

    //统计活跃用户数据
    List<RetentionUserInfo> statisticsRetentionUserInfo(
            @Param("lastDate") String lastDate);

    //导入与财务数据相关每天不同套餐的信息
    void saveStatisticsFinancialPackageInfo(
            @Param("entities") List<StatisticsFinancialPackageInfoEntity> uerInfoEntities);

    //导入每天的注册财务信息
    void saveStatisticsFinancialInfo(
            @Param("entities") List<StatisticsFinancialInfoEntity> uerInfoEntities);

    //导入每天拉新数据
    void saveStatisticsUserInfo(
            @Param("entities") List<NewUserInfoEntity> uerInfoEntities);

    //导入用户留存信息
    void saveRetentionUserInfo(
            @Param("entities") List<RetentionUserInfo> retentionUserInfos
    );
}
